package com.example.freemarker.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

/**
 * <p>
 * Index
 * </p>
 *
 * @author ross zhang
 * @version 1.0
 * @PackageName demo-one
 * @Package com.example.freemarker.controller
 * @since 2022/4/13 19:52
 */
@RestController
public class IndexController {
    @GetMapping
    public ModelAndView index(ModelAndView modelAndView){
        modelAndView.addObject("msg","我是一个成功的freemarker模板");
        modelAndView.setViewName("index");
        return modelAndView;
    }
}
